home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
umich
/
utils
/
less.arc
/
LESS.DOC
next >
Wrap
Text File
|
1985-11-20
|
13KB
|
293 lines
LESS - opposite of more
less [-cdepstwmMqQuU] [-hn] [-b[fp]n] [-xn] [+cmd] [name(s)]
LESS is a program similar to MORE, but which allows
backwards movement in the file as well as forward movement.
Also, LESS does not have to read the entire input file
before starting, so with large input files it starts up fas-
ter than text editors like vix.
Commands are based on both more and vi. Commands may
be preceeded by a decimal number, called N in the descrip-
tions below. The number is used by some commands, as indi-
cated.
As of this posting, LESS works a) from the desktop and b) in
the Mark Williams shell. It hasn't been tested with the
Breckmeyer or any other shells. All references to environment
variables in the rest of this doc refer to Msh environment
variables. Shell escapes and invocations of the editor also
work only in the Msh.
h Help: display a summary of these commands. If you for-
get all the other commands, remember this one.
SPACEScroll forward N lines, default one screen. If N is
more than the screen size, only one screenful is
displayed.
f Same as SPACE.
b Scroll backward N lines, default one screen. If N is
more than the screen size, only one screenful is
displayed.
RETURNScroll forward N lines, default 1. If N is more than
the screen size, the entire N lines are displayed.
e Same as RETURN.
j Also the same as RETURN.
y Scroll backward N lines, default 1. If N is more than
the screen size, the entire N lines are displayed.
k Same as y.
d Scroll forward N lines, default 10. If N is specified,
it becomes the new default for all d and u commands.
u Scroll backward N lines, default 10. If N is speci-
fied, it becomes the new default for all d and u com-
mands.
r Repaint the screen.
R Repaint the screen, discarding any buffered input.
Useful if the file is changing while it is being
viewed.
g Go to line N in the file, default 1 (beginning of
file). (Warning: this may be slow if N is large.)
G Go to line N in the file, default the end of the file.
(Warning: this may be slow if standard input, rather
than a file, is being read.)
p Go to a position N percent into the file. N should be
between 0 and 100. (This is possible if standard input
is being read, but only if LESS has already read to the
end of the file. It is always fast, but not always
useful.)
% Same as p.
m Followed by any lowercase letter, marks the current
position with that letter.
' Followed by any lowercase letter, returns to the posi-
tion which was previously marked with that letter. All
marks are lost when a new file is examined.
/pattern
Search forward in the file for the N-th occurence of
the pattern. N defaults to 1. The pattern is a regu-
lar expression (well, it works most of the time..).
The search starts at the second line displayed (but see
the -t option, which changes this).
?pattern
Search backward in the file for the N-th occurence of
the pattern. The search starts at the line immediately
before the top line displayed.
n Repeat previous search, for N-th occurence of the last
pattern.
E Examine a new file. If the filename is missing, the
"current" file (see the N and P commands below) from
the list of files in the command line is re-examined.
N Examine the next file (from the list of files given in
the command line). If a number N is specified (not to
be confused with the command N), the N-th next file is
examined.
P Examine the previous file. If a number N is specified,
the N-th previous file is examined.
= Prints the name of the file being viewed and the byte
offset of the bottom line being displayed. If possi-
ble, it also prints the length of the file and the per-
cent of the file above the last displayed line.
- Followed by one of the command line option letters (see
below), this will toggle the setting of that option and
print a message describing the new setting.
V Prints the version number of LESS being run.
q Exits LESS.
The following two commands at present work only with
the 'msh' of Mark Willaims C (when LESS is run from the
desktop, a 'Shell not found' message is printed out. A
fix for non-shell environments is in the offing).
v Invokes an editor to edit the current file being
viewed. The editor is taken from the environment vari-
able EDITOR, or defaults to "vi".
! shell-command
Invokes a shell to run the shell-command given.
Command line options are described below. Options are also
taken from the environment variable "LESS". (The environ-
ment variable is parsed before the command line, so command
line options override the LESS environment variable.
Options may be changed while LESS is running via the "-"
command.) For example, if you like more-style prompting, to
avoid typing "less -pm ..." each time LESS is invoked, you
might tell Msh (the Mark Williams shell):
setenv LESS=-pm
-s The -s flag causes consecutive blank lines to be
squeezed into a single blank line. This is useful when
viewing nroff output.
-t Normally, forward searches start just after the top
displayed line (that is, at the second displayed line).
Thus forward searches include the currently displayed
screen. The -t command line option causes forward
searches to start just after the bottom line displayed,
thus skipping the currently displayed screen.
-m The -m command line option causes LESS to prompt
less verbosely like more, printing the file name and
percent into the file, or just with a colon.
-M The -M command line option causes LESS to prompt even
more verbosely than more (this is the default).
-q Normally, if an attempt is made to scroll past the end
of the file or before the beginning of the file, the
terminal bell is rung to indicate this fact. The -q
command line option tells LESS not to ring the bell at